package com.jekun.helloworld.designmode.command.demo01;

/**
 * @author Administrator
 */
public class Controller {

    private AbstractCommand openCommand, closeCommand, changeCommand;

    public Controller(AbstractCommand openCommand, AbstractCommand closeCommand, AbstractCommand changeCommand) {
        this.openCommand = openCommand;
        this.closeCommand = closeCommand;
        this.changeCommand = changeCommand;
    }

    public String open() {
        return openCommand.execute();
    }

    public String change() {
        return changeCommand.execute();
    }

    public String close() {
        return closeCommand.execute();
    }
}